<?php
apf_require_controller("Abstract");
apf_require_class("Bll_Jx_Setting");
class Ajax_SetDaysController extends AbstractController {
    public function handle_request() {
        $params = $this->request->get_parameters();
        $revicwMonth = $params['revicwMonth'];
        if(empty($revicwMonth)){
            $this->json_encode(0, Const_Tip::ERROR_PARAM);
        }
        $set_bll = new Bll_Jx_Setting();
        $data = $set_bll->get_performance_days($revicwMonth);
        $last = array();
        if(!empty($data)){
            foreach ($data as $val){
                $last[] = array(
                        'step_status'=>$val['step_status'],
                        'step_date'=>date('Y-m-d',strtotime($val['step_date'])),
                        );
            }
        }
        $this->json_encode(1, $last);
    }
}